<template>
	<view class="business">
		<view class="head" :style="{height: pHeight + tHeight + 'px'}">
			<view class="xztitle" :style="[{height: pHeight + 'px', top: tHeight + 'px',lineHeight: pHeight + 'px'}]">
				账号详情
				<view class="iconfont icon-dayuhao1" @click="fanhui"></view>
			</view>
		</view>
		<view class="headtop clearfix" :style="{marginTop: pHeight + tHeight + 'px'}">
			<view class="left fl">
				{{info.userinfo.nickname}}
			</view>
		</view>
		<view class="nr">
			<view class="list">
				<view class="liebiao clearfix">
					<view class="left fl">联系人：</view>
					<view class="right fl">
						<view class="title">{{info.userinfo.lxrname}}</view>
					</view>
				</view>
				<view class="liebiao clearfix">
					<view class="left fl">联系电话：</view>
					<view class="right fl">
						<view class="title">{{info.userinfo.mobile}}</view>
					</view>
				</view>
				<view class="liebiao clearfix" v-if="role_id == 1 || role_id == 11">
					<view class="left fl">所在地：</view>
					<view class="right fl">
						<view class="title">{{info.userinfo.full_address}}</view>
					</view>
				</view>
				<view class="liebiao clearfix" v-if="limits.payouts == true">
					<view class="left fl">分成比例(%)：</view>
					<view class="right fl">
						<view class="name">充电宝：{{info.userinfo.divided}} 充电线：{{info.userinfo.dividedline}} 盒子：{{info.userinfo.dividedbox}}</view>
					</view>
				</view>
				<view class="liebiao clearfix">
					<view class="left fl">结算方式：</view>
					<view class="right fl">
						<view class="name" v-if="info.userinfo.jsfangshi==1">D+0</view>
						<view class="name" v-if="info.userinfo.jsfangshi==2">D+1</view>
						<view class="name" v-if="info.userinfo.jsfangshi==3">D+7</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl: getApp().globalData.baseUrl,
				headerTop: 0,
				pHeight: 0,
				tHeight: 0,
				formData: {
					bussinessid: ''
				},
				info: {
					userinfo: {},
					stationlist: [],
				},
				role_id: '',
				limits: {
					orderfind: false,//订单查看
					payouts: false,//分成比例
					endorder: false,//收益记录
					returnorder: false,//按日统计
				}
			}
		},
		onLoad(options) {
			// 头部距离
			let res = uni.getSystemInfoSync() ///微信api方法
			let titleH;
			if (res && res['system']) {
				// 判断是否是安卓操作系统 （标题栏苹果为44px,安卓为48px）
				if (res['system'].indexOf('Android') > 0) {
					titleH = 48
				} else {
					titleH = 46
				}
				this.headerTop = titleH + res['statusBarHeight']
				this.pHeight = titleH
				this.tHeight = res['statusBarHeight']
			}
			this.role_id = uni.getStorageSync('role_id');
			this.formData.bussinessid = options.bussinid;
			this.bussinessInfo();
		},
		methods: {
			fanhui() {
				uni.navigateBack();
			},
			bussinessInfo(){
				this.request({
					url: '/agent/bussinessstationinfo',
					data: this.formData,
					method: "GET"
				}).then(res => {
					if (res.data.code == 200) {
						this.info = res.data.data;
						
						let arr = JSON.parse(this.info.userinfo.cities);
						this.limits = arr;
					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.business {
		width: 100%;
		margin: 0 auto;
		height: 100vh;
		background: #f9f9ff;
		overflow-y: scroll;

		.head {
			width: 100%;
			position: fixed;
			top: 0;
			left: 0;
			z-index: 99;
			background: linear-gradient(90deg, #f9f9ff, #d4e8ff);

			.xztitle {
				position: fixed;
				left: 0%;
				top: 0;
				width: 100%;
				text-align: left;
				color: #333333;
				font-size: 32rpx;
				padding-left: 74rpx;
				font-weight: 700;

				.iconfont {
					position: absolute;
					top: 0;
					left: 30rpx;
					font-size: 44rpx;
				}
			}
		}

		.headtop {
			width: 100%;
			background: linear-gradient(90deg, #f9f9ff, #d4e8ff);
			height: 300rpx;
			padding: 20rpx 40rpx 0;
			box-sizing: border-box;

			.left {
				font-size: 32rpx;
				color: #333333;
				font-weight: 700;
			}

			.right {
				width: 116rpx;
				height: 36rpx;
				line-height: 36rpx;
				text-align: center;
				background: #FFFFFF;
				border-radius: 24rpx;
				margin-top: 6rpx;

				image {
					width: 36rpx;
					height: 36rpx;
					margin-left: 10rpx;
					margin-right: 6rpx;
				}

				.name {
					font-size: 24rpx;
					color: #333333;
				}
			}
		}
		
		.nr{
			width: 90%;
			margin: 0 auto;
			z-index: 70;
			margin-top: -200rpx;
			box-shadow: rgba(223, 230, 255, 0.67) 0px 0px 6px;
			
			.list{
				width: 100%;
				background: #fff;
				border-radius: 20rpx;
				margin-bottom: 20rpx;
				padding: 40rpx 40rpx 10rpx;
				position: relative;
				
				.liebiao{
					margin-bottom: 30rpx;
					
					.left{
						font-size: 24rpx;
						color: #333333;
						width: 30%;
					}
					
					.right{
						width: 65%;
						
						.title{
							font-size: 24rpx;
							color: #333333;
						}
						
						.name{
							font-size: 24rpx;
							color: #5C88FA;
						}
					}
				}
			}
		}
	}
</style>